﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using PureMVC.Interfaces;
using PureMVC.Patterns;
using SMS.Core.View.Component;

namespace SMS.Core.View
{
	public class StartupMediator : Mediator, IMediator
    {
        #region Constants

        // Cannonical name of the Mediator
        public new const string NAME = "StartupMediator";

        #endregion

        #region Constructors

        // Constructor
        public StartupMediator(Form viewComponent) 
		:base(NAME, viewComponent)
		{
            m_viewComponent = viewComponent;
            viewComponent.Load += new EventHandler(ViewComponent_Load);
        }

        #endregion

        #region Event Handlers

        private void ViewComponent_Load(object sender, EventArgs e)
        {
            (ViewComponent as LoginForm).CustomComponent = new ConnectionPanel();
            SendNotification(ApplicationConstants.STARTUP_SUCCESS, (ViewComponent as LoginForm).CustomComponent);
        }
        #endregion

        #region Private & Internal Methods

        #endregion
    }
}
